package com.xz.controller;


import com.xz.R;
import com.xz.entity.Vplayer;
import com.xz.service.VplayerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 课程视频 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2020-08-09
 */
@RestController
@RequestMapping("/video/vplayer")
public class VplayerController {
    @Autowired
    private VplayerService vplayerService;
    //发布
    @GetMapping("publish/{videoId}/{videoSourceId}")
    public R publish(@PathVariable("videoId")String videoId, @PathVariable("videoSourceId")String videoSourceId){
        //得到id
        Vplayer vplayer=new Vplayer();
        vplayer.setVideoId(videoId);
        vplayer.setVideoSourceId(videoSourceId);
        boolean save = vplayerService.save(vplayer);
        if(save)return R.ok();
        else return R.error();
    }


}

